using System;
using System.Data;
using System.Collections.Generic;
using ADOBase;
namespace eTMS.DAO{
	/********************************BEGIN SinhVienTrungTuyenDAO****************************************/
	///<summary>
	/// <para>Author: Auto generated class by CSharp Code Generator v2.0</para>
	/// <para>Date:26/10/2011 34:05:09</para>
	/// <para>Class Name: SinhVienTrungTuyenDAO</para>
	/// <para>Description: Class access to table SinhVienTrungTuyen in database. Coder should'nt code here.</para>
	///</summary>

	
	public partial class SinhVienTrungTuyenDAO : DAOBase<SinhVienTrungTuyenEntity>{


		#region Select functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateSelectOneCommand</para>
		/// <para>Input: SinhVienTrungTuyen_ID</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectOneCommand(int SinhVienTrungTuyen_ID){
			string strSQL="SELECT  [SinhVienTrungTuyen_ID],[SoBaoDanh],[HoTenSinhVien],[DiaChi],[SoCMND],[DienThoai],[GioiTinh],[NgaySinh],[KhoaHoc_ID],[HeDaoTao_ID],[DanToc],[TonGiao],[QuocGia],[NamTNPT],[DoiTuong],[KhuVuc],[QuanHuyen],[TinhThanh],[TruongDuTuyen],[NganhDuTuyen],[TruongTrungTuyen],[NganhTrungTuyen],[Lop12],[Lop11],[Lop10],[TongDiemThi],[TongDiemUuTien],[IsDaNop],[SinhVien_ID],[NgayNhap],[NguoiNhap] FROM [SinhVienTrungTuyen]  WHERE [SinhVienTrungTuyen].[SinhVienTrungTuyen_ID]=@SinhVienTrungTuyen_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@SinhVienTrungTuyen_ID",SinhVienTrungTuyen_ID);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectOne</para>
		/// <para>Input: SinhVienTrungTuyen_ID</para>
		/// <para>Output: SinhVienTrungTuyenEntity</para>
		///</summary>
		public SinhVienTrungTuyenEntity SelectOne(int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateSelectOneCommand(SinhVienTrungTuyen_ID);
			return this.Select(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateSelectAllCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllCommand(){
			string strSQL="SELECT  [SinhVienTrungTuyen_ID],[SoBaoDanh],[HoTenSinhVien],[DiaChi],[SoCMND],[DienThoai],[GioiTinh],[NgaySinh],[KhoaHoc_ID],[HeDaoTao_ID],[DanToc],[TonGiao],[QuocGia],[NamTNPT],[DoiTuong],[KhuVuc],[QuanHuyen],[TinhThanh],[TruongDuTuyen],[NganhDuTuyen],[TruongTrungTuyen],[NganhTrungTuyen],[Lop12],[Lop11],[Lop10],[TongDiemThi],[TongDiemUuTien],[IsDaNop],[SinhVien_ID],[NgayNhap],[NguoiNhap] FROM [SinhVienTrungTuyen] ";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateSelectAllByKeyCommand</para>
		/// <para>Input: ColumnName,ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllByKeyCommand(string ColumnName,object Value){
			string strSQL="SELECT  [SinhVienTrungTuyen_ID],[SoBaoDanh],[HoTenSinhVien],[DiaChi],[SoCMND],[DienThoai],[GioiTinh],[NgaySinh],[KhoaHoc_ID],[HeDaoTao_ID],[DanToc],[TonGiao],[QuocGia],[NamTNPT],[DoiTuong],[KhuVuc],[QuanHuyen],[TinhThanh],[TruongDuTuyen],[NganhDuTuyen],[TruongTrungTuyen],[NganhTrungTuyen],[Lop12],[Lop11],[Lop10],[TongDiemThi],[TongDiemUuTien],[IsDaNop],[SinhVien_ID],[NgayNhap],[NguoiNhap] FROM [SinhVienTrungTuyen]  WHERE [SinhVienTrungTuyen].["+ColumnName+"]=@ColumnName";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectAll</para>
		/// <para>Input: </para>
		/// <para>Output: List of SinhVienTrungTuyenEntity</para>
		///</summary>
		public List<SinhVienTrungTuyenEntity> SelectAll(){
			IDbCommand cmd=this.CreateSelectAllCommand();
			return this.SelectList(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectAllDS</para>
		/// <para>Input: </para>
		/// <para>Output: DataSet</para>
		///</summary>
		public DataSet SelectAllDS(){
			IDbCommand cmd=this.CreateSelectAllCommand();
			return this.SelectDS(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateSelectAllFilterCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllFilterCommand(string strFilter){
			string strSQL="SELECT  [SinhVienTrungTuyen_ID],[SoBaoDanh],[HoTenSinhVien],[DiaChi],[SoCMND],[DienThoai],[GioiTinh],[NgaySinh],[KhoaHoc_ID],[HeDaoTao_ID],[DanToc],[TonGiao],[QuocGia],[NamTNPT],[DoiTuong],[KhuVuc],[QuanHuyen],[TinhThanh],[TruongDuTuyen],[NganhDuTuyen],[TruongTrungTuyen],[NganhTrungTuyen],[Lop12],[Lop11],[Lop10],[TongDiemThi],[TongDiemUuTien],[IsDaNop],[SinhVien_ID],[NgayNhap],[NguoiNhap] FROM [SinhVienTrungTuyen]  WHERE "+RemoveInjection(strFilter);
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateSelectAllByKeyFilterCommand</para>
		/// <para>Input: ColumnName,ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateSelectAllByKeyFilterCommand(string strFilter,string ColumnName,object Value){
			string strSQL="SELECT  [SinhVienTrungTuyen_ID],[SoBaoDanh],[HoTenSinhVien],[DiaChi],[SoCMND],[DienThoai],[GioiTinh],[NgaySinh],[KhoaHoc_ID],[HeDaoTao_ID],[DanToc],[TonGiao],[QuocGia],[NamTNPT],[DoiTuong],[KhuVuc],[QuanHuyen],[TinhThanh],[TruongDuTuyen],[NganhDuTuyen],[TruongTrungTuyen],[NganhTrungTuyen],[Lop12],[Lop11],[Lop10],[TongDiemThi],[TongDiemUuTien],[IsDaNop],[SinhVien_ID],[NgayNhap],[NguoiNhap] FROM [SinhVienTrungTuyen]  WHERE [SinhVienTrungTuyen].["+ColumnName+"]=@ColumnName AND "+RemoveInjection(strFilter);
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectAll</para>
		/// <para>Input: </para>
		/// <para>Output: List of SinhVienTrungTuyenEntity</para>
		///</summary>
		public List<SinhVienTrungTuyenEntity> SelectAllFilter(string strFilter){
			IDbCommand cmd=this.CreateSelectAllFilterCommand(strFilter);
			return this.SelectList(cmd);
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SelectAllDSFilter</para>
		/// <para>Input: </para>
		/// <para>Output: DataSet</para>
		///</summary>
		public DataSet SelectAllDSFilter(string strFilter){
			IDbCommand cmd=this.CreateSelectAllFilterCommand(strFilter);
			return this.SelectDS(cmd);
		}
		#endregion

		#region Insert functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateInsertCommand</para>
		/// <para>Input: SinhVienTrungTuyenEntity</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateInsertCommand(SinhVienTrungTuyenEntity o){
			string strSQL="INSERT INTO [SinhVienTrungTuyen]([SoBaoDanh],[HoTenSinhVien],[DiaChi],[SoCMND],[DienThoai],[GioiTinh],[NgaySinh],[KhoaHoc_ID],[HeDaoTao_ID],[DanToc],[TonGiao],[QuocGia],[NamTNPT],[DoiTuong],[KhuVuc],[QuanHuyen],[TinhThanh],[TruongDuTuyen],[NganhDuTuyen],[TruongTrungTuyen],[NganhTrungTuyen],[Lop12],[Lop11],[Lop10],[TongDiemThi],[TongDiemUuTien],[IsDaNop],[SinhVien_ID],[NgayNhap],[NguoiNhap]) VALUES  (@SoBaoDanh,@HoTenSinhVien,@DiaChi,@SoCMND,@DienThoai,@GioiTinh,@NgaySinh,@KhoaHoc_ID,@HeDaoTao_ID,@DanToc,@TonGiao,@QuocGia,@NamTNPT,@DoiTuong,@KhuVuc,@QuanHuyen,@TinhThanh,@TruongDuTuyen,@NganhDuTuyen,@TruongTrungTuyen,@NganhTrungTuyen,@Lop12,@Lop11,@Lop10,@TongDiemThi,@TongDiemUuTien,@IsDaNop,@SinhVien_ID,@NgayNhap,@NguoiNhap);SELECT  @@IDENTITY";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullSoBaoDanh)
				this.CreateCommandParameter(cmd,"@SoBaoDanh",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SoBaoDanh",o.SoBaoDanh);

			if(o.IsNullHoTenSinhVien)
				this.CreateCommandParameter(cmd,"@HoTenSinhVien",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@HoTenSinhVien",o.HoTenSinhVien);

			if(o.IsNullDiaChi)
				this.CreateCommandParameter(cmd,"@DiaChi",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@DiaChi",o.DiaChi);

			if(o.IsNullSoCMND)
				this.CreateCommandParameter(cmd,"@SoCMND",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SoCMND",o.SoCMND);

			if(o.IsNullDienThoai)
				this.CreateCommandParameter(cmd,"@DienThoai",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@DienThoai",o.DienThoai);

			if(o.IsNullGioiTinh)
				this.CreateCommandParameter(cmd,"@GioiTinh",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@GioiTinh",o.GioiTinh);

			if(o.IsNullNgaySinh)
				this.CreateCommandParameter(cmd,"@NgaySinh",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@NgaySinh",o.NgaySinh);

			if(o.IsNullKhoaHoc_ID)
				this.CreateCommandParameter(cmd,"@KhoaHoc_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@KhoaHoc_ID",o.KhoaHoc_ID);

			if(o.IsNullHeDaoTao_ID)
				this.CreateCommandParameter(cmd,"@HeDaoTao_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@HeDaoTao_ID",o.HeDaoTao_ID);

			if(o.IsNullDanToc)
				this.CreateCommandParameter(cmd,"@DanToc",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@DanToc",o.DanToc);

			if(o.IsNullTonGiao)
				this.CreateCommandParameter(cmd,"@TonGiao",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@TonGiao",o.TonGiao);

			if(o.IsNullQuocGia)
				this.CreateCommandParameter(cmd,"@QuocGia",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@QuocGia",o.QuocGia);

			if(o.IsNullNamTNPT)
				this.CreateCommandParameter(cmd,"@NamTNPT",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@NamTNPT",o.NamTNPT);

			if(o.IsNullDoiTuong)
				this.CreateCommandParameter(cmd,"@DoiTuong",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@DoiTuong",o.DoiTuong);

			if(o.IsNullKhuVuc)
				this.CreateCommandParameter(cmd,"@KhuVuc",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@KhuVuc",o.KhuVuc);

			if(o.IsNullQuanHuyen)
				this.CreateCommandParameter(cmd,"@QuanHuyen",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@QuanHuyen",o.QuanHuyen);

			if(o.IsNullTinhThanh)
				this.CreateCommandParameter(cmd,"@TinhThanh",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@TinhThanh",o.TinhThanh);

			if(o.IsNullTruongDuTuyen)
				this.CreateCommandParameter(cmd,"@TruongDuTuyen",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@TruongDuTuyen",o.TruongDuTuyen);

			if(o.IsNullNganhDuTuyen)
				this.CreateCommandParameter(cmd,"@NganhDuTuyen",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@NganhDuTuyen",o.NganhDuTuyen);

			if(o.IsNullTruongTrungTuyen)
				this.CreateCommandParameter(cmd,"@TruongTrungTuyen",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@TruongTrungTuyen",o.TruongTrungTuyen);

			if(o.IsNullNganhTrungTuyen)
				this.CreateCommandParameter(cmd,"@NganhTrungTuyen",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@NganhTrungTuyen",o.NganhTrungTuyen);

			if(o.IsNullLop12)
				this.CreateCommandParameter(cmd,"@Lop12",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@Lop12",o.Lop12);

			if(o.IsNullLop11)
				this.CreateCommandParameter(cmd,"@Lop11",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@Lop11",o.Lop11);

			if(o.IsNullLop10)
				this.CreateCommandParameter(cmd,"@Lop10",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@Lop10",o.Lop10);

			if(o.IsNullTongDiemThi)
				this.CreateCommandParameter(cmd,"@TongDiemThi",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@TongDiemThi",o.TongDiemThi);

			if(o.IsNullTongDiemUuTien)
				this.CreateCommandParameter(cmd,"@TongDiemUuTien",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@TongDiemUuTien",o.TongDiemUuTien);

			if(o.IsNullIsDaNop)
				this.CreateCommandParameter(cmd,"@IsDaNop",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@IsDaNop",o.IsDaNop);

			if(o.IsNullSinhVien_ID)
				this.CreateCommandParameter(cmd,"@SinhVien_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SinhVien_ID",o.SinhVien_ID);

			if(o.IsNullNgayNhap)
				this.CreateCommandParameter(cmd,"@NgayNhap",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@NgayNhap",o.NgayNhap);

			if(o.IsNullNguoiNhap)
				this.CreateCommandParameter(cmd,"@NguoiNhap",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@NguoiNhap",o.NguoiNhap);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: Save</para>
		/// <para>Input: SinhVienTrungTuyenEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Save(SinhVienTrungTuyenEntity o){
			bool result=false;
			IDbCommand cmd=this.CreateInsertCommand(o);
			object id=this.ExecuteScalar(cmd,ref result);
			cmd.Dispose();
			try{
				o.SinhVienTrungTuyen_ID=int.Parse(Convert.ToString(id));
			}
			catch{}
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: SaveList</para>
		/// <para>Input: List of SinhVienTrungTuyenEntity</para>
		/// <para>Output: </para>
		///</summary>
		public void SaveList(List<SinhVienTrungTuyenEntity>list){
			foreach(SinhVienTrungTuyenEntity o in list){
				try{
					this.Save(o);
				}
				catch{
				}
			}
		}
		#endregion

		#region Update functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateUpdateCommand</para>
		/// <para>Input: SinhVienTrungTuyenEntity</para>
		/// <para>Output: </para>
		///</summary>
		protected IDbCommand CreateUpdateCommand(SinhVienTrungTuyenEntity o){
			string strSQL="UPDATE  [SinhVienTrungTuyen] SET [SinhVienTrungTuyen].[SoBaoDanh]=@SoBaoDanh,[SinhVienTrungTuyen].[HoTenSinhVien]=@HoTenSinhVien,[SinhVienTrungTuyen].[DiaChi]=@DiaChi,[SinhVienTrungTuyen].[SoCMND]=@SoCMND,[SinhVienTrungTuyen].[DienThoai]=@DienThoai,[SinhVienTrungTuyen].[GioiTinh]=@GioiTinh,[SinhVienTrungTuyen].[NgaySinh]=@NgaySinh,[SinhVienTrungTuyen].[KhoaHoc_ID]=@KhoaHoc_ID,[SinhVienTrungTuyen].[HeDaoTao_ID]=@HeDaoTao_ID,[SinhVienTrungTuyen].[DanToc]=@DanToc,[SinhVienTrungTuyen].[TonGiao]=@TonGiao,[SinhVienTrungTuyen].[QuocGia]=@QuocGia,[SinhVienTrungTuyen].[NamTNPT]=@NamTNPT,[SinhVienTrungTuyen].[DoiTuong]=@DoiTuong,[SinhVienTrungTuyen].[KhuVuc]=@KhuVuc,[SinhVienTrungTuyen].[QuanHuyen]=@QuanHuyen,[SinhVienTrungTuyen].[TinhThanh]=@TinhThanh,[SinhVienTrungTuyen].[TruongDuTuyen]=@TruongDuTuyen,[SinhVienTrungTuyen].[NganhDuTuyen]=@NganhDuTuyen,[SinhVienTrungTuyen].[TruongTrungTuyen]=@TruongTrungTuyen,[SinhVienTrungTuyen].[NganhTrungTuyen]=@NganhTrungTuyen,[SinhVienTrungTuyen].[Lop12]=@Lop12,[SinhVienTrungTuyen].[Lop11]=@Lop11,[SinhVienTrungTuyen].[Lop10]=@Lop10,[SinhVienTrungTuyen].[TongDiemThi]=@TongDiemThi,[SinhVienTrungTuyen].[TongDiemUuTien]=@TongDiemUuTien,[SinhVienTrungTuyen].[IsDaNop]=@IsDaNop,[SinhVienTrungTuyen].[SinhVien_ID]=@SinhVien_ID,[SinhVienTrungTuyen].[NgayNhap]=@NgayNhap,[SinhVienTrungTuyen].[NguoiNhap]=@NguoiNhap WHERE [SinhVienTrungTuyen].[SinhVienTrungTuyen_ID]=@SinhVienTrungTuyen_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullSinhVienTrungTuyen_ID)
				this.CreateCommandParameter(cmd,"@SinhVienTrungTuyen_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SinhVienTrungTuyen_ID",o.SinhVienTrungTuyen_ID);

			if(o.IsNullSoBaoDanh)
				this.CreateCommandParameter(cmd,"@SoBaoDanh",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SoBaoDanh",o.SoBaoDanh);

			if(o.IsNullHoTenSinhVien)
				this.CreateCommandParameter(cmd,"@HoTenSinhVien",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@HoTenSinhVien",o.HoTenSinhVien);

			if(o.IsNullDiaChi)
				this.CreateCommandParameter(cmd,"@DiaChi",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@DiaChi",o.DiaChi);

			if(o.IsNullSoCMND)
				this.CreateCommandParameter(cmd,"@SoCMND",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SoCMND",o.SoCMND);

			if(o.IsNullDienThoai)
				this.CreateCommandParameter(cmd,"@DienThoai",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@DienThoai",o.DienThoai);

			if(o.IsNullGioiTinh)
				this.CreateCommandParameter(cmd,"@GioiTinh",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@GioiTinh",o.GioiTinh);

			if(o.IsNullNgaySinh)
				this.CreateCommandParameter(cmd,"@NgaySinh",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@NgaySinh",o.NgaySinh);

			if(o.IsNullKhoaHoc_ID)
				this.CreateCommandParameter(cmd,"@KhoaHoc_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@KhoaHoc_ID",o.KhoaHoc_ID);

			if(o.IsNullHeDaoTao_ID)
				this.CreateCommandParameter(cmd,"@HeDaoTao_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@HeDaoTao_ID",o.HeDaoTao_ID);

			if(o.IsNullDanToc)
				this.CreateCommandParameter(cmd,"@DanToc",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@DanToc",o.DanToc);

			if(o.IsNullTonGiao)
				this.CreateCommandParameter(cmd,"@TonGiao",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@TonGiao",o.TonGiao);

			if(o.IsNullQuocGia)
				this.CreateCommandParameter(cmd,"@QuocGia",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@QuocGia",o.QuocGia);

			if(o.IsNullNamTNPT)
				this.CreateCommandParameter(cmd,"@NamTNPT",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@NamTNPT",o.NamTNPT);

			if(o.IsNullDoiTuong)
				this.CreateCommandParameter(cmd,"@DoiTuong",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@DoiTuong",o.DoiTuong);

			if(o.IsNullKhuVuc)
				this.CreateCommandParameter(cmd,"@KhuVuc",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@KhuVuc",o.KhuVuc);

			if(o.IsNullQuanHuyen)
				this.CreateCommandParameter(cmd,"@QuanHuyen",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@QuanHuyen",o.QuanHuyen);

			if(o.IsNullTinhThanh)
				this.CreateCommandParameter(cmd,"@TinhThanh",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@TinhThanh",o.TinhThanh);

			if(o.IsNullTruongDuTuyen)
				this.CreateCommandParameter(cmd,"@TruongDuTuyen",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@TruongDuTuyen",o.TruongDuTuyen);

			if(o.IsNullNganhDuTuyen)
				this.CreateCommandParameter(cmd,"@NganhDuTuyen",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@NganhDuTuyen",o.NganhDuTuyen);

			if(o.IsNullTruongTrungTuyen)
				this.CreateCommandParameter(cmd,"@TruongTrungTuyen",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@TruongTrungTuyen",o.TruongTrungTuyen);

			if(o.IsNullNganhTrungTuyen)
				this.CreateCommandParameter(cmd,"@NganhTrungTuyen",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@NganhTrungTuyen",o.NganhTrungTuyen);

			if(o.IsNullLop12)
				this.CreateCommandParameter(cmd,"@Lop12",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@Lop12",o.Lop12);

			if(o.IsNullLop11)
				this.CreateCommandParameter(cmd,"@Lop11",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@Lop11",o.Lop11);

			if(o.IsNullLop10)
				this.CreateCommandParameter(cmd,"@Lop10",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@Lop10",o.Lop10);

			if(o.IsNullTongDiemThi)
				this.CreateCommandParameter(cmd,"@TongDiemThi",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@TongDiemThi",o.TongDiemThi);

			if(o.IsNullTongDiemUuTien)
				this.CreateCommandParameter(cmd,"@TongDiemUuTien",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@TongDiemUuTien",o.TongDiemUuTien);

			if(o.IsNullIsDaNop)
				this.CreateCommandParameter(cmd,"@IsDaNop",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@IsDaNop",o.IsDaNop);

			if(o.IsNullSinhVien_ID)
				this.CreateCommandParameter(cmd,"@SinhVien_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SinhVien_ID",o.SinhVien_ID);

			if(o.IsNullNgayNhap)
				this.CreateCommandParameter(cmd,"@NgayNhap",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@NgayNhap",o.NgayNhap);

			if(o.IsNullNguoiNhap)
				this.CreateCommandParameter(cmd,"@NguoiNhap",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@NguoiNhap",o.NguoiNhap);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateUpdateFieldCommand</para>
		/// <para>Input: ColumnName,ColumnValue,SinhVienTrungTuyen_ID</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateUpdateFieldCommand(string ColumnName,object Value,int SinhVienTrungTuyen_ID){
			string strSQL="UPDATE  [SinhVienTrungTuyen] SET [SinhVienTrungTuyen].["+ColumnName+"]=@ColumnName WHERE [SinhVienTrungTuyen].[SinhVienTrungTuyen_ID]=@SinhVienTrungTuyen_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@SinhVienTrungTuyen_ID",SinhVienTrungTuyen_ID);



			this.CreateCommandParameter(cmd,"@ColumnName",Value);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: Update</para>
		/// <para>Input: SinhVienTrungTuyenEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Update(SinhVienTrungTuyenEntity o){
			IDbCommand cmd=this.CreateUpdateCommand(o);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateList</para>
		/// <para>Input: List of SinhVienTrungTuyenEntity</para>
		/// <para>Output: </para>
		///</summary>
		public void UpdateList(List<SinhVienTrungTuyenEntity>list){
			foreach(SinhVienTrungTuyenEntity o in list){
				try{
					this.Update(o);
				}
				catch{
				}
			}
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateSoBaoDanh</para>
		/// <para>Input: NewSoBaoDanh,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateSoBaoDanh(string NewSoBaoDanh,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("SoBaoDanh",NewSoBaoDanh,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateHoTenSinhVien</para>
		/// <para>Input: NewHoTenSinhVien,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateHoTenSinhVien(string NewHoTenSinhVien,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("HoTenSinhVien",NewHoTenSinhVien,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateDiaChi</para>
		/// <para>Input: NewDiaChi,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateDiaChi(string NewDiaChi,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("DiaChi",NewDiaChi,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateSoCMND</para>
		/// <para>Input: NewSoCMND,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateSoCMND(string NewSoCMND,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("SoCMND",NewSoCMND,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateDienThoai</para>
		/// <para>Input: NewDienThoai,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateDienThoai(string NewDienThoai,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("DienThoai",NewDienThoai,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateGioiTinh</para>
		/// <para>Input: NewGioiTinh,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateGioiTinh(bool NewGioiTinh,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("GioiTinh",NewGioiTinh,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateNgaySinh</para>
		/// <para>Input: NewNgaySinh,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateNgaySinh(string NewNgaySinh,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("NgaySinh",NewNgaySinh,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateKhoaHoc_ID</para>
		/// <para>Input: NewKhoaHoc_ID,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateKhoaHoc_ID(int NewKhoaHoc_ID,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("KhoaHoc_ID",NewKhoaHoc_ID,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateHeDaoTao_ID</para>
		/// <para>Input: NewHeDaoTao_ID,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateHeDaoTao_ID(int NewHeDaoTao_ID,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("HeDaoTao_ID",NewHeDaoTao_ID,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateDanToc</para>
		/// <para>Input: NewDanToc,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateDanToc(string NewDanToc,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("DanToc",NewDanToc,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateTonGiao</para>
		/// <para>Input: NewTonGiao,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateTonGiao(string NewTonGiao,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("TonGiao",NewTonGiao,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateQuocGia</para>
		/// <para>Input: NewQuocGia,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateQuocGia(string NewQuocGia,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("QuocGia",NewQuocGia,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateNamTNPT</para>
		/// <para>Input: NewNamTNPT,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateNamTNPT(int NewNamTNPT,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("NamTNPT",NewNamTNPT,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateDoiTuong</para>
		/// <para>Input: NewDoiTuong,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateDoiTuong(string NewDoiTuong,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("DoiTuong",NewDoiTuong,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateKhuVuc</para>
		/// <para>Input: NewKhuVuc,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateKhuVuc(string NewKhuVuc,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("KhuVuc",NewKhuVuc,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateQuanHuyen</para>
		/// <para>Input: NewQuanHuyen,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateQuanHuyen(string NewQuanHuyen,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("QuanHuyen",NewQuanHuyen,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateTinhThanh</para>
		/// <para>Input: NewTinhThanh,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateTinhThanh(string NewTinhThanh,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("TinhThanh",NewTinhThanh,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateTruongDuTuyen</para>
		/// <para>Input: NewTruongDuTuyen,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateTruongDuTuyen(string NewTruongDuTuyen,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("TruongDuTuyen",NewTruongDuTuyen,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateNganhDuTuyen</para>
		/// <para>Input: NewNganhDuTuyen,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateNganhDuTuyen(string NewNganhDuTuyen,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("NganhDuTuyen",NewNganhDuTuyen,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateTruongTrungTuyen</para>
		/// <para>Input: NewTruongTrungTuyen,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateTruongTrungTuyen(string NewTruongTrungTuyen,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("TruongTrungTuyen",NewTruongTrungTuyen,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateNganhTrungTuyen</para>
		/// <para>Input: NewNganhTrungTuyen,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateNganhTrungTuyen(string NewNganhTrungTuyen,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("NganhTrungTuyen",NewNganhTrungTuyen,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateLop12</para>
		/// <para>Input: NewLop12,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateLop12(string NewLop12,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("Lop12",NewLop12,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateLop11</para>
		/// <para>Input: NewLop11,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateLop11(string NewLop11,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("Lop11",NewLop11,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateLop10</para>
		/// <para>Input: NewLop10,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateLop10(string NewLop10,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("Lop10",NewLop10,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateTongDiemThi</para>
		/// <para>Input: NewTongDiemThi,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateTongDiemThi(Decimal NewTongDiemThi,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("TongDiemThi",NewTongDiemThi,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateTongDiemUuTien</para>
		/// <para>Input: NewTongDiemUuTien,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateTongDiemUuTien(Decimal NewTongDiemUuTien,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("TongDiemUuTien",NewTongDiemUuTien,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateIsDaNop</para>
		/// <para>Input: NewIsDaNop,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateIsDaNop(bool NewIsDaNop,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("IsDaNop",NewIsDaNop,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateSinhVien_ID</para>
		/// <para>Input: NewSinhVien_ID,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateSinhVien_ID(int NewSinhVien_ID,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("SinhVien_ID",NewSinhVien_ID,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateNgayNhap</para>
		/// <para>Input: NewNgayNhap,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateNgayNhap(DateTime NewNgayNhap,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("NgayNhap",NewNgayNhap,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: UpdateNguoiNhap</para>
		/// <para>Input: NewNguoiNhap,SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool UpdateNguoiNhap(string NewNguoiNhap,int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateUpdateFieldCommand("NguoiNhap",NewNguoiNhap,SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		#endregion

		#region Delete functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: DeleteAllCommand</para>
		/// <para>Input: </para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteAllCommand(){
			string strSQL="DELETE   FROM [SinhVienTrungTuyen]  ";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: DeleteCommand</para>
		/// <para>Input: SinhVienTrungTuyenEntity</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteCommand(SinhVienTrungTuyenEntity o){
			string strSQL="DELETE   FROM [SinhVienTrungTuyen]   WHERE [SinhVienTrungTuyen].[SinhVienTrungTuyen_ID]=@SinhVienTrungTuyen_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			if(o.IsNullSinhVienTrungTuyen_ID)
				this.CreateCommandParameter(cmd,"@SinhVienTrungTuyen_ID",System.DBNull.Value);
			else
				this.CreateCommandParameter(cmd,"@SinhVienTrungTuyen_ID",o.SinhVienTrungTuyen_ID);


			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: DeleteAll</para>
		/// <para>Input: </para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool DeleteAll(){
			IDbCommand cmd=this.CreateDeleteAllCommand();
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateDeleteByPrimaryKeyCommand</para>
		/// <para>Input: SinhVienTrungTuyen_ID</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteByPrimaryKeyCommand(int SinhVienTrungTuyen_ID){
			string strSQL="DELETE   FROM [SinhVienTrungTuyen]   WHERE [SinhVienTrungTuyen].[SinhVienTrungTuyen_ID]=@SinhVienTrungTuyen_ID";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@SinhVienTrungTuyen_ID",SinhVienTrungTuyen_ID);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: CreateDeleteByKeyCommand</para>
		/// <para>Input: ColumnName , ColumnValue</para>
		/// <para>Output: IDbCommand</para>
		///</summary>
		protected IDbCommand CreateDeleteByKeyCommand(string ColumnName,object Value){
			string strSQL="DELETE   FROM [SinhVienTrungTuyen]   WHERE [SinhVienTrungTuyen].["+ColumnName+"]=@ColumnName";
			IDbCommand cmd=this.CreateCommand(strSQL);
			cmd.CommandType=CommandType.Text;
			this.CreateCommandParameter(cmd,"@ColumnName",Value);



			return cmd;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: Delete</para>
		/// <para>Input: SinhVienTrungTuyenEntity</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool Delete(SinhVienTrungTuyenEntity o){
			IDbCommand cmd=this.CreateDeleteCommand(o);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: DeleteByID</para>
		/// <para>Input: SinhVienTrungTuyen_ID</para>
		/// <para>Output: return true if succeeded else return false</para>
		///</summary>
		public bool DeleteByID(int SinhVienTrungTuyen_ID){
			IDbCommand cmd=this.CreateDeleteByPrimaryKeyCommand(SinhVienTrungTuyen_ID);
			bool result=this.ExcuteNoneQuery(cmd);
			cmd.Dispose();
			return result;
		}
		#endregion

		#region Select join to KhoaHoc functions
		#endregion

		#region Select,delete by SinhVienTrungTuyen_ID functions
		#endregion

		#region Select,delete by KhoaHoc_ID functions
		#endregion

		#region MapObject functions
		///<summary>
		/// <para>Author: Auto generated by CSharp Code Generator v2.0</para>
		/// <para>Date:26/10/2011 34:05:09</para>
		/// <para>Name: MapObject</para>
		/// <para>Input: IDataReader</para>
		/// <para>Output: SinhVienTrungTuyenEntity</para>
		///</summary>
		protected override SinhVienTrungTuyenEntity MapObject(IDataReader r){
			SinhVienTrungTuyenEntity entity = new SinhVienTrungTuyenEntity();
			try{
				if(r.FieldCount>0){
					try
					{
						int ordinal = r.GetOrdinal("SinhVienTrungTuyen_ID");
						if (!r.IsDBNull(ordinal)) entity.SinhVienTrungTuyen_ID = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("SoBaoDanh");
						if (!r.IsDBNull(ordinal)) entity.SoBaoDanh = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("HoTenSinhVien");
						if (!r.IsDBNull(ordinal)) entity.HoTenSinhVien = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("DiaChi");
						if (!r.IsDBNull(ordinal)) entity.DiaChi = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("SoCMND");
						if (!r.IsDBNull(ordinal)) entity.SoCMND = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("DienThoai");
						if (!r.IsDBNull(ordinal)) entity.DienThoai = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("GioiTinh");
						if (!r.IsDBNull(ordinal)) entity.GioiTinh = ((bool)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("NgaySinh");
						if (!r.IsDBNull(ordinal)) entity.NgaySinh = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("KhoaHoc_ID");
						if (!r.IsDBNull(ordinal)) entity.KhoaHoc_ID = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("HeDaoTao_ID");
						if (!r.IsDBNull(ordinal)) entity.HeDaoTao_ID = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("DanToc");
						if (!r.IsDBNull(ordinal)) entity.DanToc = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("TonGiao");
						if (!r.IsDBNull(ordinal)) entity.TonGiao = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("QuocGia");
						if (!r.IsDBNull(ordinal)) entity.QuocGia = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("NamTNPT");
						if (!r.IsDBNull(ordinal)) entity.NamTNPT = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("DoiTuong");
						if (!r.IsDBNull(ordinal)) entity.DoiTuong = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("KhuVuc");
						if (!r.IsDBNull(ordinal)) entity.KhuVuc = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("QuanHuyen");
						if (!r.IsDBNull(ordinal)) entity.QuanHuyen = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("TinhThanh");
						if (!r.IsDBNull(ordinal)) entity.TinhThanh = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("TruongDuTuyen");
						if (!r.IsDBNull(ordinal)) entity.TruongDuTuyen = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("NganhDuTuyen");
						if (!r.IsDBNull(ordinal)) entity.NganhDuTuyen = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("TruongTrungTuyen");
						if (!r.IsDBNull(ordinal)) entity.TruongTrungTuyen = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("NganhTrungTuyen");
						if (!r.IsDBNull(ordinal)) entity.NganhTrungTuyen = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("Lop12");
						if (!r.IsDBNull(ordinal)) entity.Lop12 = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("Lop11");
						if (!r.IsDBNull(ordinal)) entity.Lop11 = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("Lop10");
						if (!r.IsDBNull(ordinal)) entity.Lop10 = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("TongDiemThi");
						if (!r.IsDBNull(ordinal)) entity.TongDiemThi = (Convert.ToDecimal(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("TongDiemUuTien");
						if (!r.IsDBNull(ordinal)) entity.TongDiemUuTien = (Convert.ToDecimal(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("IsDaNop");
						if (!r.IsDBNull(ordinal)) entity.IsDaNop = ((bool)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("SinhVien_ID");
						if (!r.IsDBNull(ordinal)) entity.SinhVien_ID = ((int)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("NgayNhap");
						if (!r.IsDBNull(ordinal)) entity.NgayNhap = ((DateTime)(r.GetValue(ordinal)));
					}
					catch{}
					try
					{
						int ordinal = r.GetOrdinal("NguoiNhap");
						if (!r.IsDBNull(ordinal)) entity.NguoiNhap = ((string)(r.GetValue(ordinal)));
					}
					catch{}
					return entity;
				}
			}catch{}
			return null;
		}
		#endregion
	}
	/*****************************************************************************************************/
	/**********************************END SinhVienTrungTuyenDAOBase*****************************************/
	/*****************************************************************************************************/
}

